import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../components/login.vue'
import forget from '../components/forget.vue'
import modify from '../components/modify.vue'
import home from '../components/home.vue'
import form from '../components/form.vue'
import lend from '../components/lend.vue'
import equipment from '../components/equipment.vue'
import run from '../components/run.vue'
import develop from '../components/develop.vue'
import submitted from '../components/submitted.vue'
import information from '../components/information.vue'
import welcome from '@/components/welcome.vue'
import back from '../components/back.vue'
import register from '../components/register.vue'

Vue.use(VueRouter)

const routes = [
    { path: '/', redirect: '/login' },
    { path: '/register', component: register },
    { path: '/login', component: login },
    { path: '/forget', component: forget },
    { path: '/modify', component: modify },
    {
        path: '/home',
        component: home,
        redirect: '/form',
        children: [
            { path: '/welcome', component: welcome },
            { path: '/form', component: form },
            { path: '/lend', component: lend },
            { path: '/equipment', component: equipment },
            { path: '/run', component: run },
            { path: '/develop', component: develop },
            { path: '/submitted', component: submitted },
            { path: '/information', component: information },
            { path: '/back', component: back }
        ]
    },
]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router